package com.rabbit.mq.listener;

import com.rabbit.mq.config.TopicRabbitConfig;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @version V1.0.0
 * @ClassName: {@link Queue02Listener}
 * @Description: 队列监听器
 * @author: Lanzhou
 * @date: 2021/3/17 9:40
 * @Copyright:2020 All rights reserved.
 */

@Component
@RabbitListener(queues = TopicRabbitConfig.W)
public class Queue02Listener {

    @RabbitHandler
    public void process(Map<String, String> result) {
        try {
            Thread.sleep(3000L);
            System.out.println("Queue02Listener: " + result.toString());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }


}
